package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.TeacherClassMapper;
import com.education.wisdom.pojo.TeacherClass;
import com.education.wisdom.service.ITeacherClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学生班级关系 服务层实现
 *
 * @author ruoyi
 * @date 2019-06-26
 */
@Service
public class TeacherClassServiceImpl implements ITeacherClassService {
    @Autowired
    private TeacherClassMapper teacherClassMapper;

    /**
     * 查询学生班级关系信息
     *
     * @param teacherId 学生班级关系ID
     * @return 学生班级关系信息
     */
    @Override
    public TeacherClass selectTeacherClassById(String teacherId) {
        return teacherClassMapper.selectTeacherClassById(teacherId);
    }

    /**
     * 查询学生班级关系列表
     *
     * @param teacherClass 学生班级关系信息
     * @return 学生班级关系集合
     */
    @Override
    public List<TeacherClass> selectTeacherClassList(TeacherClass teacherClass) {
        return teacherClassMapper.selectTeacherClassList(teacherClass);
    }

    /**
     * 新增学生班级关系
     *
     * @param teacherClass 学生班级关系信息
     * @return 结果
     */
    @Override
    public int insertTeacherClass(TeacherClass teacherClass) {
        return teacherClassMapper.insertTeacherClass(teacherClass);
    }

    /**
     * 修改学生班级关系
     *
     * @param teacherClass 学生班级关系信息
     * @return 结果
     */
    @Override
    public int updateTeacherClass(TeacherClass teacherClass) {
        return teacherClassMapper.updateTeacherClass(teacherClass);
    }

    /**
     * 删除学生班级关系对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTeacherClassByIds(String ids) {
        return teacherClassMapper.deleteTeacherClassByIds(Convert.toStrArray(ids));
    }

    @Override
    public int deleteTeacherClassByCIds(Integer classId) {
        return teacherClassMapper.deleteTeacherClassByCIds(classId);
    }

    @Override
    public List<TeacherClass> selectByTeacherId(String userId) {
        return teacherClassMapper.selectByTeacherId(userId);
    }

}
